<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Info extends CI_Controller {

	function __construct(){
		parent::__construct();
		$this->load->model('info_model');
	}

	function _remap($method)
	{
		$types = array('about','brand','contribution','contact','join','friend','japan');
		if( !in_array($method,$types)){show_404();}
		$this->info($method);
	}
	public function info($type){
	
		$data['p'] = $p = $this->info_model->get_info_bytype($type);

		if(!$p) show_error('该新闻可能已经被删除');

		//最新动态
		$this->load->model('news_model');
		$data['news'] = $this->news_model->get_news(0,PAGENUM,true);

		//专业知识
		$this->load->model('know_model');
		$data['know'] = $this->know_model->get_know(0,PAGENUM,true);

		switch($type){
			case 'about':$data['title'] = '关于我们';break;
			case 'brand':$data['title'] = '品牌故事';break;
			case 'contribution':$data['title'] = '社会贡献';break;
			case 'contact':$data['title'] = '联系我们';break;
			case 'join':$data['title'] = '加入我们';break;
			case 'friend':$data['title'] = '友情链接';break;
			case 'japan':$data['title'] = '日本定制';break;
		}


		$this->load->view('info.tpl',$data);
		
	}

}

/* End of file production.php */
/* Location: ./application/controllers/admin/production.php */